package epam.com.runner;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import epam.com.classes.WorkOfFiles;


public class Runner {

	private static Properties props = new Properties();
	private static String outputFileName;
	private static String inputFileName;

	private static void loadProperties() throws FileNotFoundException,
			IOException {
		
		props = new Properties();
		props.load(new FileInputStream("config.properties"));
		outputFileName = props.getProperty("outputFileName");
		inputFileName = props.getProperty("inputFileName");
	}

	public static void main(String[] args) throws FileNotFoundException, IOException {

		loadProperties();
		WorkOfFiles workOfFiles = new WorkOfFiles(inputFileName, outputFileName);
		workOfFiles.changeFirstAndLastWords();
		workOfFiles.printOutFile();
		workOfFiles.infoText();
	}

}
